#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
AC_INIT([sshband], [0.1], [gs@bbxy.net])
AC_CONFIG_SRCDIR([src/mysql.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE(sshband, 0.1)

# Checks for programs.
AC_PROG_CC

# Checks for libraries.
AC_CHECK_LIB([mysqlclient], 
	     [mysql_init],
	     [],
	     AC_MSG_ERROR(mysqlclient library not found.))

AC_CHECK_LIB([pcap],
	     [pcap_loop],
	     [],
	     AC_MSG_ERROR(pcap library  not found.))


# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h])

AC_CHECK_HEADER([mysql/mysql.h],
		[],
		AC_MSG_ERROR(header file mysql/mysql.h not found),
		[AC_INCLUDES_DEFAULT])

AC_CHECK_HEADER([pcap.h],
		[],
		AC_MSG_ERROR(header file pcap.h not found),
		[AC_INCLUDES_DEFAULT])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT8_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT64_T

# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_CHECK_FUNCS([inet_ntoa memmove memset strchr strerror strrchr strstr])

AC_CONFIG_FILES([Makefile
                 src/Makefile
                 doc/Makefile] )
AC_OUTPUT
